

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>fix insert/stream command &mdash; LIGGGHTS v3.X documentation</title>
  

  
  
  
  

  

  
  
    

  

  
  
    <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  

  

  
    <link rel="top" title="LIGGGHTS v3.X documentation" href="index.html"/> 

  
  <script src="_static/js/modernizr.min.js"></script>

</head>

<body class="wy-body-for-nav" role="document">

   
  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search">
          

          
            <a href="Manual.html" class="icon icon-home"> LIGGGHTS
          

          
          </a>

          
            
            
              <div class="version">
                v3.X
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul>
<li class="toctree-l1"><a class="reference internal" href="Section_intro.html">1. Introduction</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_start.html">2. Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_input_script.html">3. Input Script</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_commands.html">4. Commands</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_gran_models.html">5. Contact models</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_mesh_modules.html">6. Mesh modules</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_packages.html">7. Packages</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_howto.html">8. How-to discussions</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_modify.html">9. Modifying &amp; extending LIGGGHTS(R)-PUBLIC</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_python.html">10. Python interface to LIGGGHTS(R)-PUBLIC</a></li>
<li class="toctree-l1"><a class="reference internal" href="Section_errors.html">11. Errors</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="Manual.html">LIGGGHTS</a>
        
      </nav>


      
      <div class="wy-nav-content">
        <div class="rst-content">
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="Manual.html">Docs</a> &raquo;</li>
        
      <li>fix insert/stream command</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="_sources/fix_insert_stream.txt" rel="nofollow"> View page source</a>
          
          <a href="http://www.cfdem.com"> Website</a>
          
            <a href="Section_commands.html#comm" rel="nofollow"> Commands</a>
            
          
        
      </li>
    
  </ul>

  
  <hr/>
  
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="fix-insert-stream-command">
<span id="index-0"></span><h1>fix insert/stream command<a class="headerlink" href="#fix-insert-stream-command" title="Permalink to this headline">¶</a></h1>
<div class="section" id="syntax">
<h2>Syntax<a class="headerlink" href="#syntax" title="Permalink to this headline">¶</a></h2>
<div class="highlight-python"><div class="highlight"><pre>fix ID group-ID insert/stream seed seed_value distributiontemplate dist-ID general_keywords general_values stream_keywords stream_values ...
</pre></div>
</div>
<ul class="simple">
<li>ID, group-ID are documented in <a class="reference internal" href="fix.html"><em>fix</em></a> command</li>
<li>insert/stream = style name of this fix command</li>
<li>seed = obligatory keyword</li>
<li>seed_value = random # seed (prime number greater 1000)</li>
<li>distributiontemplate = obligatory keyword</li>
<li>dist-ID = ID of a <a class="reference internal" href="fix_particledistribution_discrete.html"><em>fix_particledistribution_discrete</em></a> to be used for particle insertion</li>
<li>one or more general keyword/value pairs can be appended</li>
<li>general_keywords = <em>verbose</em> or <em>maxattampt</em> or <em>nparticles</em> or <em>mass</em> or <em>particlerate</em> or <em>massrate</em> or <em>insert_every</em> or <em>overlapcheck</em> or <em>all_in</em> or <em>random_distribute</em> or*vel constant* or <em>vel uniform</em> or <em>vel gaussian</em> or <em>orientation</em> or <em>omega</em> or <em>set_property</em></li>
</ul>
<pre class="literal-block">
<em>verbose</em> = yes or no
<em>maxattempt</em> value = ma
  ma = max # of insertion attempts per atom (positive integer)
<em>nparticles</em> values = np or INF
  np =  number of particles to insert (positive integer)
  INF =  insert as many particles as possible
<em>mass</em> values = mp
  mp = mass of particles to be inserted (positive float)
  INF =  insert as many particles as possible
<em>particlerate</em> values = pr
  pr = particle insertion rate (particles/time units)
<em>massrate</em> values = mr
  mr = mass insertion rate (mass/time units)
<em>insert_every</em> value = ie
  ie = every how many time-steps particles are inserted - insertion happens periodically (positive integer)
<em>start</em> value = ts
  ts = time-step at which insertion should start (positive integer larger than current time-step)
<em>overlapcheck</em> value = yes or no
<em>all_in</em> value = yes or no
<em>random_distribute</em> value = exact or uncorrelated
<em>compress_tags</em> value = yes or no
<em>vel constant</em> values = vx vy vz
  vx = x-velocity at insertion (velocity units)
  vy = y-velocity at insertion (velocity units)
  vz = z-velocity at insertion (velocity units)
<em>vel uniform</em> values = vx vy vz vFluctx vFlucty vFluctz
  vx = mean x-velocity at insertion (velocity units)
  vy = mean y-velocity at insertion (velocity units)
  vz = mean z-velocity at insertion (velocity units)
  vFluctx = amplitude of uniform x-velocity fluctuation at insertion (velocity units)
  vFlucty = amplitude of uniform y-velocity fluctuation at insertion (velocity units)
  vFluctz = amplitude of uniform z-velocity fluctuation at insertion (velocity units)
<em>vel gaussian</em> values = vx vy vz vFluctx vFlucty vFluctz
  vx = mean x-velocity at insertion (velocity units)
  vy = mean y-velocity at insertion (velocity units)
  vz = mean z-velocity at insertion (velocity units)
  vFluctx = standard deviation of Gaussian x-velocity fluctuation at insertion (velocity units)
  vFlucty = standard deviation of Gaussian y-velocity fluctuation at insertion (velocity units)
  vFluctz = standard deviation of Gaussian z-velocity fluctuation at insertion (velocity units)
<em>orientation</em> values = random or template or constant q1 q2 q3 q4
  random = randomize rotational orientation
  template = use orientation from particle template
  constant = use constant quaternion for orientation
  q1 q2 q3 q4 = quaternion values for constant orientation
<em>omega</em> values = constant omegax omegay omegaz
  constant = obligatory word
  omegax = x-component of angular velocity (1/time units)
  omegay = y-component of angular velocity (1/time units)
  omegaz = z-component of angular velocity (1/time units)
<em>set_property</em> values = property-varname val
  property-varname = variable name of a <a class="reference internal" href="fix_property.html"><em>fix property/atom</em></a> holding a scalar value for each particle
  val = value to initialize the property with upon insertion
</pre>
<ul class="simple">
<li>following the general keyword/value section, one or more stream keyword/value pairs can be appended for the fix insert/stream command</li>
<li>stream_keywords = <em>duration</em> or <em>parallel</em> or <em>insertion_face</em> or <em>extrude_length</em></li>
</ul>
<pre class="literal-block">
<em>insertion_face</em> value = mesh-ID
  mesh-ID = ID of the <a class="reference internal" href="fix_mesh_surface.html"><em>fix mesh/surface or fix mesh/surface/planar</em></a> to use as starting face for particle generation
<em>extrude_length</em> values = L
  L =  length for extruding the insertion face in normal direction so to generate in insertion volume
<em>parallel</em> values = yes or no
  yes, no = pre-calculate location of overlap of processor subdomains and extrusion volume to some extent
<em>duration</em> values = du
  du =  duration of insertion in time-steps
</pre>
</div>
<div class="section" id="examples">
<h2>Examples<a class="headerlink" href="#examples" title="Permalink to this headline">¶</a></h2>
<p>fix ins all insert/stream seed 123457 distributiontemplate pdd1 nparticles 5000 vel constant 0. -0.5 -2. particlerate 1000 overlapcheck yes insertion_face ins_mesh extrude_length 0.6</p>
</div>
<div class="section" id="description">
<h2>Description<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>Insert particles into a granular run either once or every few timesteps
within a specified region until either np particles have been inserted
or the desired particle mass (mp) has been reached.</p>
<p>The <em>verbose</em> keyword controls whether statistics about particle
insertion is output to the screen each time particles are inserted.</p>
<p>Each timestep particles are inserted, they are placed randomly inside
the insertion volume so as to mimic a stream of poured particles. The
insertion volume is generated by extruding the insertion face as
specified via <em>insertion_face</em> in the direction of the face normal.
The sign of this face normal is automatically flipped so that it
is opposite to the normal component of the insertion velocity.</p>
<p>To specify the number of particles to be inserted, you must use either
the <em>nparticles</em> or the <em>mass</em> keyword (but not both). In the latter
case, the number of particles to be inserted is calculated from the
mass expectancy given by the particle distribution. The <em>start</em> keyword
can be used to set the time-step at which the insertion should start.</p>
<p>Likewise, you can use the <em>particlerate</em> or the <em>massrate</em> keyword (but not both)
to control the insertion rate. Particles are not inserted continuously,
but in packets (for efficiency reasons). Particles are inserted again
after enough time has elapsed that the previously inserted particles
have left the insertion volume.</p>
<p>One of the two keywords <em>insert_every</em> and <em>extrude_length</em> must be
provided by the user (but not both).</p>
<p>In case <em>insert_every</em> is defined, this sets the frequency of the particle
insertion directly, i.e. the number of time-steps between two insertions.
The number of particles to be inserted at each insertion event is calculated
from the insertion rate and <em>insert_every</em>.</p>
<p>If <em>extrude_length</em> is specified, the amount of extrusion is fixed and
the insertion frequency is calculated from <em>extrude_length</em> and the insertion
velocity normal to the insertion face.</p>
<p>When defining <em>insert_every</em>, you have the possibility to define the duration
of each insertion via the <em>duration</em> keyword. <em>duration</em> &lt; <em>insert_every</em>
will generate a &#8220;pulsed&#8221; stream as opposed to a continuous stream.
Example: Setting <em>insert_every</em> = 1000 and <em>duration</em> = 600 will produce
a stream that pours material for 600 time-steps, will pause for 400 time-steps,
pour for another 600 time-steps etc.</p>
<p>As mentioned above, particles are inserted again after enough time has
elapsed that the previously inserted particles have left the insertion
volume. Until the time these particles reach the insertion face, no
other forces affect the particles (pair forces, gravity etc.). Fix
insert/stream internally issues a special integrator to take care
of this. This procedure guarantees that the specified velocity,
omega etc. values are perfectly met at the specified insertion face.</p>
<p>The larger the volume, the more particles that can be inserted at one
insertion step. Insertions will continue until the desired # of particles
has been inserted.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The insertion face must be a planar face, and the insertion
velocity projected on the face normal must be non-zero.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Keywords <em>insert_every</em> and <em>extrude_length</em> may not be used
together</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Keywords <em>duration</em> and <em>extrude_length</em> cannot be used together.</p>
</div>
<p>This command must use the distributiontemplate keyword to refer to a
<a class="reference internal" href="fix_particledistribution_discrete.html"><em>fix_particledistribution_discrete</em></a> (defined by dist-fix-ID) that defines the properties of the
inserted particles.</p>
<p>Inserted particles are assigned the atom type specified by the
particledistribution defined via the
<a class="reference internal" href="fix_particledistribution_discrete.html"><em>fix_particledistribution_discrete</em></a> and
are assigned to 4 groups: the default group &#8220;all&#8221; and the group
specified in the fix insert command, as well as the groups specified
in the <a class="reference internal" href="fix_particledistribution_discrete.html"><em>fix_particledistribution_discrete</em></a>
and <a class="reference internal" href="fix_particletemplate_sphere.html"><em>fix_particletemplate_sphere</em></a>
command (all of which can also be &#8220;all&#8221;).</p>
<p>The keyword <em>overlapcheck</em> controls if overlap is checked for at insertion,
both within the inserted particle package and with other existing particles.
If this option is turned off, insertion will scale very well in parallel,
otherwise not. Be aware that in case of no overlap check, highly overlapping
configurations will be produced, so you will have to relax these configurations.</p>
<p>If overlapcheck if performed, the number of insertion attempts per
particle can be specified via the <em>maxattempt</em> keyword. Each timestep
particles are inserted, the command will make up to a total of M tries
to insert the new particles without overlaps, where
M = # of inserted particles * ma.  If unsuccessful at completing all
insertions, a warning will be printed.</p>
<p>The <em>all_in</em> flag determines if the particle is completely contained
in the insertion region (<em>all_in = yes</em>) or only the particle center
(<em>all_in = no</em>).Using <em>all_in</em> = yes requires you to use an insertion
face of style <a class="reference internal" href="fix_mesh_surface.html"><em>fix mesh/surface/planar</em></a></p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">You also have to use <a class="reference internal" href="fix_mesh_surface.html"><em>fix mesh/surface/planar</em></a>
if there is a <a class="reference internal" href="run.html"><em>run</em></a> command between the definition of the
insertion face and the fix insert/stream command. Otherwise, a
<a class="reference internal" href="fix_mesh_surface.html"><em>fix mesh/surface/planar</em></a> will do.</p>
</div>
<p>Keyword <em>random_distribute</em> controls how the number of particles to
be inserted is distributed among parallel processors and among the
particle templates in the particle distribution. For style <em>exact</em>,
the number of particles to be inserted each step is matched exactly.
For style <em>uncorrelated</em>, the number of particles to be inserted
for each particle template will be rounded in an uncorrelated way,
so the total number of inserted particles may vary for each insertion
step. However, statistically both ways should produce the same
result. Style <em>uncorrelated</em> may be faster in parallel since it
does not need global MPI operations.
Please note that if the # of particles to be inserted is calculated
e.g. from a particle mass to be inserted, the number of particles
to be inserted each insertion step will vary by 1, irrespective of
the <em>random_distribute</em> settings. This is because in this case the
# of particles to insert in each step will be a floating point number,
and applying a simple floor/ceil rounding operation would lead to a
statistical bias.</p>
<p>If keyword <em>parallel</em> is set to &#8216;yes&#8217;, LIGGGHTS(R)-PUBLIC tries to pre-calculate
more accurately the overlap of process subdomains and extrusion volume.
For cases where the insertion volume is highly divided between different
processes, this can lead to a speed-up of insertion as random number generation
is more efficient. For cases where the extrusion volume is divided
among few processes this will impose a small computation overhead.</p>
<p>If keyword <em>compress_tags</em> is set to &#8216;yes&#8217;, then atom IDs are re-assigned
after each insertion procedure. The default is &#8216;no&#8217;. This is typically
only recommended if some models internally store arrays which have the
length defined via the max ID of any atom.</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">Setting <em>compress_tags</em> to &#8216;yes&#8217; will result in all contact
history to be lost at that point in time. External post-processing tools
will give wrong results because they typically track atoms via their IDs.</p>
</div>
<p>The initial velocity and rotational velocity can be controlled via the
<em>vel</em> and <em>omega</em> keywords. <em>vel constant</em> simply patches a constant
velocity to the inserted particles, <em>vel uniform</em> sets uniformly distributed
velocities with mean and amplitude. <em>vel gaussian</em> sets Gaussian
distributed particle velocities with mean and std. deviation.
The insertion velocity must be non-zero.</p>
<p>The <em>set_property</em> option can be used to initialize scalar per-particle
properties such as temperatures, which are stored in a
a <a class="reference internal" href="fix_property.html"><em>fix property/atom</em></a>.</p>
<p>The setting of <em>compress_tags</em> will trigger a periodic re-tagging of
atom ids. This is usefull in case the simulation domain is used to
model a periodic in and outflow of particles. If this switch is set,
the global ids of the particles will remain in a certain range,
and no &#8220;holes&#8221; in the arrays holding the global atom ids exist.
IMPORTANT NOTE: This functionality may confuse external tools which
perform post-processing based on atom IDs!</p>
</div>
<div class="section" id="restart-fix-modify-output-run-start-stop-minimize-info">
<h2>Restart, fix_modify, output, run start/stop, minimize info<a class="headerlink" href="#restart-fix-modify-output-run-start-stop-minimize-info" title="Permalink to this headline">¶</a></h2>
<p>Information about this fix is written to <a class="reference internal" href="restart.html"><em>binary restart files</em></a>.  This means you can restart a simulation simulation
while inserting particles, when the restart file was written during the
insertion operation.</p>
<p>None of the <a class="reference internal" href="fix_modify.html"><em>fix_modify</em></a> options are relevant to this
fix. A global vector is stored by this fix for access by various <span class="xref std std-ref">output commands</span>. The first component of the vector is the
number of particles already inserted, the second component is the mass
of particles already inserted. No parameter of this fix can be
used with the <em>start/stop</em> keywords of the <a class="reference internal" href="run.html"><em>run</em></a> command.
This fix is not invoked during <code class="xref doc docutils literal"><span class="pre">energy</span> <span class="pre">minimization</span></code>.</p>
</div>
<div class="section" id="restrictions">
<h2>Restrictions<a class="headerlink" href="#restrictions" title="Permalink to this headline">¶</a></h2>
<p>Keywords <em>duration</em> and <em>extrude_length</em> can not be used together.
The insertion face cannot move.</p>
</div>
<div class="section" id="related-commands">
<h2>Related commands<a class="headerlink" href="#related-commands" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="fix_insert_pack.html"><em>fix_insert_pack</em></a>,
<a class="reference internal" href="fix_insert_rate_region.html"><em>fix_insert_rate_region</em></a>,</p>
</div>
<div class="section" id="default">
<h2>Default<a class="headerlink" href="#default" title="Permalink to this headline">¶</a></h2>
<p>The defaults are maxattempt = 50, all_in = no, overlapcheck = yes
vel = 0.0 0.0 0.0, omega = 0.0 0.0 0.0, start = next time-step,
duration = insert_every, random_distribute = exact, parallel = no,
<em>compress_tags</em> = no</p>
</div>
</div>


           </div>
           <div class="articleComments">
            
           </div>
          </div>
          <footer>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2016, DCS Computing GmbH, JKU Linz and Sandia Corporation.

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  

    <script type="text/javascript">
        var DOCUMENTATION_OPTIONS = {
            URL_ROOT:'./',
            VERSION:'v3.X',
            LANGUAGE:'None',
            COLLAPSE_INDEX:false,
            FILE_SUFFIX:'.html',
            HAS_SOURCE:  true,
            SOURCELINK_SUFFIX: ''
        };
    </script>
      <script type="text/javascript" src="_static/jquery.js"></script>
      <script type="text/javascript" src="_static/underscore.js"></script>
      <script type="text/javascript" src="_static/doctools.js"></script>

  

  
  
    <script type="text/javascript" src="_static/js/theme.js"></script>
  

  
  
  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.StickyNav.enable();
      });
  </script>
   

</body>
</html>